package cn.da.shuai.cool.ai.tool;

import cn.da.shuai.cool.ai.model.dto.WeatherDTO;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

@Component
public class WeatherTool {

    @Tool(description = "根据城市ID查询天气")
    public WeatherDTO getWeather(@ToolParam(description = "城市ID") String cityId) {
        // 获取天气信息
        return WeatherDTO
                .builder()
                .weather("晴")
                .temperature("25")
                .humidity("60")
                .airQuality("优")
                .city("北京")
                .weatherIcon("晴")
                .updateTime("2023-05-01 12:00:00")
                .windDirection("南风")
                .build();
    }
}
